# 声明并使用变量
# 声明变量的方式: 变量名 = 值
# 变量的作用: 在程序运行过程中临时保存数据

# 声明变量
i = 1
s = "abc"
print("i = " + str(i) + ", s = " + s)

# 批量声明多个变量,变量可以为不同的类型
a, b, c = 1, 0.5, "c"
print("a = " + str(a) + ", b = " + str(b) + ", c = " + c)

# 变量的连续赋值
x = y = z = 123
print("x = " + str(x) + ", y = " + str(y) + ", z = " + str(z))

# 对于连续赋值的变量,如果修改x的值,相当于开辟了一块新空间,并将x指向新空间,而y和z还是指向原来的值
# 变量的值可以随意修改
x = "456"
print("x = " + str(x) + ", y = " + str(y) + ", z = " + str(z))

pi = 3.141592653589793
print("pi = " + str(pi))
